<html
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui">

    <ui:composition template="layout.xhtml">

        <ui:define name="title">
            #{ managerCriarTipoSaida.tipoSaida.id == null ? 'Cadastrar Tipo de Saída' : 'Editar Tipo de Saída'  }
        </ui:define>

        <ui:define name="content">
            <h:form id="criarTipoSaidaForm">
                <p:messages id="criarTipoSaidaMessages" autoUpdate="true" />

                <div class="actions">
                    <div id="buttons">

                        <p:button value="Pesquisar" outcome="pesquisarTipoSaida.xhtml"
                                  icon="ui-icon-search"
                                  styleClass="ui-priority-primary">
                        </p:button>
                    </div>
                </div>

                <p:fieldset legend="Dados">
                    <div class="row">
                        <div class="column2">
                            <p:outputLabel value="Descrição" for="descricaoInputText" />
                        </div>
                        <div class="column9">
                            <p:inputText id="descricaoInputText" value="#{ managerCriarTipoSaida.tipoSaida.descricao }"
                                         required="true" requiredMessage="Descrição é obrigatório" maxlength="60" />
                        </div>
                    </div>
                </p:fieldset>

                <div class="command">
                    <p:commandButton actionListener="#{ managerCriarTipoSaida.salvar() }"
                                     value="Salvar" update="@form"
                                     styleClass="ui-priority-primary" 
                                     icon="ui-icon-disk"  onsuccess="goY(0);" />
                    <p:button value="Cancelar" icon="ui-icon-cancel" href="pesquisarTipoSaida.xhtml" />
                </div>

            </h:form>
        </ui:define>

    </ui:composition>

</html>